package com.smasher.serialport;

import android.content.Context;


public interface SerialPortImpl {

    /**
     * 初始化 rtu
     *
     * @param path     path
     * @param baud     baud
     * @param databits databits
     * @param parity   NONE ODD EVEN MARK SPACE
     * @param stopbits stopbits
     */
    void init(String path, int baud, int databits, String parity, int stopbits);

    void open();

    void close();

    void write(byte[] sendData);

    void read(byte[] sendData);

    void addDataReceiveListener(OnDataReceiveListener listener);

    String[] getAllDevicesPath(Context context);

    void setDebug(boolean isDebug);

}

